/* 监控面板自定义样式 */

/* 卡片边框颜色 */
.border-left-primary {
    border-left: 0.25rem solid #4e73df !important;
}

.border-left-success {
    border-left: 0.25rem solid #1cc88a !important;
}

.border-left-info {
    border-left: 0.25rem solid #36b9cc !important;
}

.border-left-warning {
    border-left: 0.25rem solid #f6c23e !important;
}

.border-left-danger {
    border-left: 0.25rem solid #e74a3b !important;
}

/* 图表容器 */
.chart-area {
    position: relative;
    height: 300px;
}

.chart-pie {
    position: relative;
    height: 250px;
}

/* 状态徽章 */
.badge {
    font-size: 0.75em;
    padding: 0.375rem 0.75rem;
}

.bg-success {
    background-color: #1cc88a !important;
}

.bg-warning {
    background-color: #f6c23e !important;
    color: #212529 !important;
}

.bg-danger {
    background-color: #e74a3b !important;
}

.bg-secondary {
    background-color: #858796 !important;
}

/* 实时数据指示器 */
.realtime-indicator {
    position: relative;
}

.realtime-indicator::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -15px;
    width: 8px;
    height: 8px;
    background-color: #1cc88a;
    border-radius: 50%;
    animation: pulse 2s infinite;
    transform: translateY(-50%);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(28, 200, 138, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(28, 200, 138, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(28, 200, 138, 0);
    }
}

/* 数据加载状态 */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 告警级别颜色 */
.alert-level-info {
    color: #36b9cc;
}

.alert-level-warning {
    color: #f6c23e;
}

.alert-level-error {
    color: #e74a3b;
}

.alert-level-critical {
    color: #e74a3b;
    font-weight: bold;
}

/* 策略状态表格 */
.strategy-status-table {
    font-size: 0.875rem;
}

.strategy-status-table th {
    border-top: none;
    font-weight: 600;
    color: #5a5c69;
    background-color: #f8f9fc;
}

.strategy-status-table td {
    vertical-align: middle;
}

/* 收益颜色 */
.profit-positive {
    color: #1cc88a;
    font-weight: 600;
}

.profit-negative {
    color: #e74a3b;
    font-weight: 600;
}

.profit-neutral {
    color: #858796;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .chart-area {
        height: 200px;
    }
    
    .chart-pie {
        height: 180px;
    }
    
    .card-body {
        padding: 1rem 0.75rem;
    }
    
    .h5 {
        font-size: 1.1rem;
    }
}

/* WebSocket连接状态 */
.websocket-connected {
    border-left: 4px solid #1cc88a;
}

.websocket-disconnected {
    border-left: 4px solid #f6c23e;
}

.websocket-error {
    border-left: 4px solid #e74a3b;
}

/* 自动刷新按钮状态 */
.auto-refresh-active {
    background-color: #1cc88a;
    border-color: #1cc88a;
    color: white;
}

.auto-refresh-active:hover {
    background-color: #17a673;
    border-color: #17a673;
}

/* 数据更新动画 */
.data-updated {
    animation: highlight 0.5s ease-in-out;
}

@keyframes highlight {
    0% {
        background-color: rgba(78, 115, 223, 0.1);
    }
    100% {
        background-color: transparent;
    }
}

/* 图表工具提示自定义 */
.chart-tooltip {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
}

/* 策略列表项 */
.strategy-item {
    transition: all 0.2s ease-in-out;
}

.strategy-item:hover {
    background-color: #f8f9fc;
    transform: translateY(-1px);
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

/* 告警列表项 */
.alert-item {
    border-left: 4px solid transparent;
    transition: all 0.2s ease-in-out;
}

.alert-item.alert-info {
    border-left-color: #36b9cc;
}

.alert-item.alert-warning {
    border-left-color: #f6c23e;
}

.alert-item.alert-error {
    border-left-color: #e74a3b;
}

.alert-item.alert-critical {
    border-left-color: #e74a3b;
    background-color: rgba(231, 74, 59, 0.05);
}

/* 时间范围选择器 */
.time-range-selector .dropdown-item.active {
    background-color: #4e73df;
    color: white;
}

/* 数据为空状态 */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: #858796;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 加载状态 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* 性能指标卡片 */
.metric-card {
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 2rem 0 rgba(58, 59, 69, 0.2);
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.metric-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 深色主题支持 */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #2d3748;
        border-color: #4a5568;
    }
    
    .card-header {
        background-color: #374151;
        border-bottom-color: #4a5568;
    }
    
    .table {
        color: #e2e8f0;
    }
    
    .table th {
        background-color: #374151;
        border-color: #4a5568;
    }
    
    .table td {
        border-color: #4a5568;
    }
    
    .text-gray-800 {
        color: #e2e8f0 !important;
    }
    
    .text-muted {
        color: #a0aec0 !important;
    }
}